﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Runtime.InteropServices;
using System.Net.Sockets;
using System.IO;
using System.Net;

namespace music_control
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class Options : Window
    {
        private ViewModel _viewmodel;

        public Options(ViewModel viewmodel)
        {
            InitializeComponent();


            this.DataContext = _viewmodel = viewmodel;
        }

        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (ViewModel.isChanged)
            {
                MessageBoxResult ans = MessageBox.Show("Do you want to close the options-window without save the changes?", "music-control", MessageBoxButton.YesNo, MessageBoxImage.Question);

                if (ans == MessageBoxResult.No)
                {
                    e.Cancel = true;
                }
            }
        }
    }
}
